package com.automannn.atm_back.modules.codeGenerator.environment;

import lombok.extern.slf4j.Slf4j;

/**
 * @author chenkh
 * @time 2020/6/29 20:52
 */
@Slf4j
public final class EnvironmentPerception {
    private static DatasourceType datasourceType;

    private static String namespace;

    public static void setDatasourceType(DatasourceType datasourceType) {
        if(datasourceType!=null){
            EnvironmentPerception.datasourceType = datasourceType;
        }else {
            log.info("环境已经变动，建议重启项目!");
            EnvironmentPerception.datasourceType = datasourceType;
        }
    }

    public static DatasourceType getDatasourceType() {
        return datasourceType;
    }

    public static String getNamespace() {
        return namespace;
    }

    public static void setNamespace(String namespace) {
        EnvironmentPerception.namespace = namespace;
    }
}
